<?php

namespace App\Modules\Admin\Entities\Property;

use App\Models\Model;
use App\Modules\Admin\Entities\Water\CommunityModel;
use App\Modules\Admin\Entities\Water\WaterDeviceModel;
use Illuminate\Database\Eloquent\Relations\HasOne;

//维保
class MaintenanceModel extends Model
{
    protected $table='maintenance_standard';
    protected $primaryKey='maintenance_id';

    /**
     * @return HasOne
     */
    public function community(): HasOne
    {
        return $this->hasOne(CommunityModel::class, 'id', 'community_id')->select(['id','title']);
    }
    /**
     * @return HasOne
     */
    public function water_device_info(): HasOne
    {
        return $this->hasOne(WaterDeviceModel::class, 'water_id','water_id')->select(['water_id','water_title']);
    }

}
